import 'package:flutter/material.dart';
import 'package:flutter_drag_scale_widget/flutter_drag_scale_widget.dart';

class ImageShow extends StatefulWidget {
  const ImageShow({Key? key}) : super(key: key);

  @override
  State<ImageShow> createState() => _ImageShowState();
}

class _ImageShowState extends State<ImageShow> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("图片浏览器 双指放大图片"),),
      body: Center(
        child: buildRow(),
      ),
    );
    
  }
  List<String> _imageList = [
    "https://gimg2.baidu.com/image_search/src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20180920%2F4f580d8b60494985865589e7c5e63ba5.png&refer=http%3A%2F%2F5b0988e595225.cdn.sohucs.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1656081970&t=5954f191b9230cacdee2333d7091f1d7",
    "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F4ee5266e3601c72350bc90befce70465bb080504399e5-YXLvkV_fw658&refer=http%3A%2F%2Fhbimg.b0.upaiyun.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1656082046&t=21d978302e4fd5c01f810c06c59edf8b",
    "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage109.360doc.com%2FDownloadImg%2F2019%2F04%2F2311%2F159545015_4_20190423111104206.png&refer=http%3A%2F%2Fimage109.360doc.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1656082046&t=8442b0b45d0c02d822673caa250b321c",
  ];
  Widget buildRow(){
    return ImageShowPageView(
      //图片数据
      imageList: _imageList,
      //图片的类型
      imageShowType: ImageShowType.NET,
      //图片的填充方式
      boxFit: BoxFit.contain,
      onPageChanged: (int index) {
        //滑动回调
      },
    );
  }
}